package com.anyisn.anyflickr.modules.PhotoInfo
{
	import com.adobe.webapis.flickr.Photo;
	
	import flash.display.Bitmap;
	
	import com.anyisn.puremvc.as3.multicore.utilities.pipes.component.PipeAwareModule;
	
	public class PhotoInfoModule extends PipeAwareModule
	{
		public static const NAME:String = 'PhotoInfoModule';
		
		public function PhotoInfoModule(bitmap:Bitmap, photo:Photo)
		{	
			_bitmap = bitmap;
			_photo = photo;
			super(PhotoInfoModuleFacade.getInstance(moduleID));
			
			(facade as PhotoInfoModuleFacade).startup(this);
		}
		
		public function getID():String {
			return moduleID;
		}
		
		public function exportPhotoInfoWindow():void {
			facade.sendNotification(PhotoInfoModuleFacade.GET_PHOTO_INFO_WINDOW);
		}
		
		private static function getNextID():String
		{
			return NAME + '/' + serial++;
		}
		
		public function get photo():Photo {
			return _photo;
		}
		
		public function get bitmap():Bitmap {
			return _bitmap;
		}
		
		private var _bitmap:Bitmap;
		private var _photo:Photo;
		private static var serial:Number = 0;
		private var moduleID:String = PhotoInfoModule.getNextID();
	}
}